package com.yyfax.pay.order.data.dao.protocol;

import com.yyfax.pay.order.model.domain.ProtocolUntieOrderDO;
import org.apache.ibatis.annotations.Param;

public interface ProtocolUntieOrderDao {
	/**
	 * 保存协议解绑订单
	 * 
	 * @author wangjwy
	 * @date 2018/6/5 10:58
	 * @since 2.2.0
	 * @param record
	 * @return int
	 * @throws Exception
	 */
	int insert(ProtocolUntieOrderDO record);

	/**
	 * 更新协议解绑订单状态
	 * 
	 * @author wangjwy
	 * @date 2018/6/5 13:36
	 * @since 2.2.0
	 * @param busiId, state, orignState, respCode, respDesc
	 * @return int
	 * @throws Exception
	 */
	int modifyState(@Param("busiId") String busiId, @Param("state") Integer state, @Param("orignState") Integer orignState,
			@Param("respCode") Integer respCode, @Param("respDesc") String respDesc);

	/**
	 * 根据主键查询
	 * 
	 * @author wangjwy
	 * @date 2018/6/9 18:10
	 * @since 2.2.0
	 * @param busiId
	 * @return com.yyfax.pay.order.model.domain.ProtocolUntieOrderDO
	 * @throws Exception
	 */
	ProtocolUntieOrderDO selectByPrimary(@Param("busiId") String busiId);

	/**
	 * 根据用户和商户号查询
	 * 
	 * @author wangjwy
	 * @date 2018/6/19 9:43
	 * @since 1.0.0
	 * @param merchantCode, userId
	 * @return com.yyfax.pay.order.model.domain.ProtocolUntieOrderDO
	 * @throws Exception
	 */
	ProtocolUntieOrderDO selectByMerchantCodeAndUserId(@Param("merchantCode") String merchantCode, @Param("userId") String userId);

	/**
	 * 更新订单状态
	 * 
	 * @author wangjwy
	 * @date 2018/6/19 10:24
	 * @since 2.2.0
	 * @param busiId, state, orignState
	 * @return int
	 * @throws Exception
	 */
	int updateState(@Param("busiId") String busiId, @Param("state") Integer state, @Param("orignState") Integer orignState);
}